<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
	<title>资料修改</title>
   	<%@ include file="/WEB-INF/jsp/public/commons.jspf" %>
<script type="text/javascript" >
$(function() {


	var yz2=true;
	var yz3 ;
	var yz4 ;



	$("#yz2").blur(function() {
		if ($("#yz2").val().trim() == "") {
			$("#msg2").html("不能为空");
			yz2 =false;
		} else {
			$("#msg2").html("");
			yz2 =true;
		}
	});

	$("#yz3").blur(function() {
		// 验证电话
		var reg = /^(\+\d{2,3}\-)?\d{11}$/;
		if (!reg.test($("#yz3").val())) {
			$("#msg3").html("请输入正确的电话号码!");
			yz3 = false;
		} else {
			$("#msg3").html("");
			yz3 = true;
		}
	});

	$("#yz4").blur(function() {
		// 验证邮箱
		var reg = /^\w{3,}@\w+(\.\w+)+$/;
		if (!reg.test($("#yz4").val())) {
			$("#msg4").html("请输入正确的Email!");
			yz4 = false;
		} else {
			$("#msg4").html("");
			yz4 = true;
		}
	});


	$("#save").bind("click", function agin() {
		if(yz2&&yz3&&yz4){
			return true;
		}else{
			if ($("#yz2").val().trim() == "") {
			$("#msg2").html("不能为空");
			
		} 
		
		var reg = /^(\+\d{2,3}\-)?\d{11}$/;
		if (!reg.test($("#yz3").val())) {
			$("#msg3").html("请输入正确的电话号码!");
		}else{
		 yz3=true;
		}
		
		reg = /^\w{3,}@\w+(\.\w+)+$/;
		if (!reg.test($("#yz4").val())) {
			$("#msg4").html("请输入正确的Email!");
		} else{
		yz4=true;
		}
			if(yz2&&yz3&&yz4){
			return true;}else{
			return false;
			}
		}
	});
});
</script>
</head>
<body>

<!-- 标题显示 -->
<div id="Title_bar">
    <div id="Title_bar_Head">
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 资料修改
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<!--显示表单内容-->
<div id=MainArea>

    <s:form action="user_save">
    	<s:hidden name="id"></s:hidden>
    	<s:hidden name="role"></s:hidden>
    	<s:hidden name="username"></s:hidden>
    	<s:hidden name="password"></s:hidden>
        
        <div class="ItemBlock_Title1"><!-- 信息说明 --><div class="ItemBlock_Title1">
        	<img border="0" width="4" height="7" src="${pageContext.request.contextPath}/style/blue/images/item_point.gif" /> 资料修改 </div> 
        </div>
        
        <!-- 表单内容显示 -->
        <div class="ItemBlockBorder">
            <div class="ItemBlock">
                <table cellpadding="0" cellspacing="0" class="mainForm">
                    <font color="red"><s:fielderror/></font>
                    <tr><td>用户名</td>
                        <td>
                       ${username} 
						</td>
                    </tr>
                    <tr><td>姓名</td>
                        <td><s:textfield id="yz2" name="name" cssClass="InputStyle"/> *<label id="msg2"></label></td>
                    </tr>
					<tr><td>性别</td>
                        <td>
                        	
							<%-- <s:radio name="sex" list="%{ #{'男':'男', '女':'女'} }"></s:radio> --%>
							<s:radio name="sex" list="#{'男':'男', '女':'女'}" ></s:radio>
                        	
							<!-- <s:radio name="sex" list="{'男', '女'}"></s:radio> -->

						</td>
                    </tr>
					<tr><td>手机号</td>
                        <td><s:textfield id="yz3" name="phoneNumber" cssClass="InputStyle"/><label id="msg3"></label></td>
                    </tr>
                    <tr><td>E-mail</td>
                        <td><s:textfield id="yz4" name="email" cssClass="InputStyle"/><label id="msg4"></label></td>
                    </tr>
                  
                </table>
            </div>
        </div>
        
	
        <!-- 表单操作 -->
        <div id="InputDetailBar">
            <input id="save" type="image" src="${pageContext.request.contextPath}/style/images/save.png"/>
            <a href="javascript:history.go(-1);"><img src="${pageContext.request.contextPath}/style/images/goBack.png"/></a>
        </div>
    </s:form>
</div>


</body>
</html>
